﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit.aspx.cs" Inherits="StoreWeb.system.memberManage.edit" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../../lib/html5.js"></script>
<script type="text/javascript" src="../../lib/respond.min.js"></script>
<script type="text/javascript" src="../../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>客户资料</title>
</head>
<body>
    <div class="pd-20">
        <form runat="server" method="post" class="form form-horizontal" id="formmemberadd">
            <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>客户名称：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="username" name="username" runat="server" datatype="*1-50" nullmsg="经销商名称不能为空" readonly>
                </div>
                 <div class="col-4"> </div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">手机号：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="mobile" name="mobile" runat="server" readonly>
                </div>
            </div>


            <div class="row cl">
                <label class="form-label col-2">省市区：</label>
                <div class="formControls col-6">
                          <div class="text-l"> 
                              <span class="select-box inline">
                              <select name="typelist" id="s_province" class="select" runat="server" ></select>
                              </span> 
                               <span class="select-box inline">
                              <select name="parentlist" id="s_city" class="select" runat="server" ></select>
                              </span>
                              <span class="select-box inline">
                              <select name="parentlist" id="s_county" class="select" runat="server" ></select>
                              </span>
                         </div>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">详细地址：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="address" name="address" runat="server" readonly>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">性别：</label>
                <div class="formControls col-6">
                    <asp:RadioButton ID="radSex0" runat="server"  Text="保密"  GroupName="sex" Enabled="false"  />
                    <asp:RadioButton ID="radSex1" runat="server"  Text="男"  GroupName="sex"  Enabled="false" />
                    <asp:RadioButton ID="radSex2" runat="server" Text="女" GroupName="sex"  Enabled="false"  />
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">邮箱：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="emal" name="emal" runat="server" readonly>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">生日：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="birthday" name="birthday" runat="server" readonly>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">星座：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="constellation" name="constellation" runat="server" readonly>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">体重：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="weight" name="weight" runat="server" readonly>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">身高：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="height" name="height" runat="server" readonly>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">身份类型：</label>
                <div class="formControls col-6">
                    <asp:RadioButton ID="RadioButton1" runat="server"  Text="普通"  GroupName="isvip"/>
                    <asp:RadioButton ID="RadioButton2" runat="server"  Text="会员"  GroupName="isvip"/>
                </div>
            </div>


            <div class="row cl">
                <label class="form-label col-2">会员等级：</label>
                <div class="formControls col-6">
                    <asp:DropDownList ID="ddlmemberGrade" runat="server" Width="200" class="input-text" nullmsg="" ></asp:DropDownList>
                 </div>
            </div>


            <div class="row cl">
                <div class="col-10 col-offset-2">
                    <asp:HiddenField ID="hidid" runat="server" />
                   <%-- <asp:Button ID="btnok" runat="server" CssClass="btn btn-success radius" Text="确定" />--%>
                </div>
            </div>
        </form>
    </div>
    <script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../../lib/Validform/5.3.2/Validform.min.js"></script>
    <script type="text/javascript" src="../../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../js/H-ui.js"></script>
    <script type="text/javascript" src="../../js/H-ui.admin.js"></script>
    <script type="text/javascript" src="../../js/area.js"></script>
    <script>
        _init_area();
    </script>
    <script>
        $(function () {
            $("#formmemberadd").Validform({
                tiptype: 2,
                btnSubmit: "#btnok",
                beforeSubmit: function (curform) {
                    ////alert($("#s_province").val());
                    ////alert($("#s_city").val());
                    ////alert($("#s_county").val());

                    var isvipcheck = "";
                    var isvip = document.getElementsByName("isvip");
                    for (var i = 0; i < isvip.length; i++) {
                        if (isvip[i].checked) {
                            isvipcheck = isvip[i].value;
                        }
                    }
                    //选择是普通就把等级设置为0
                    if (isvipcheck == "RadioButton1") {
                        $("#ddlmemberGrade").val(0);
                    }
                    //选择是会员就必须选择等级
                    if (isvipcheck == "RadioButton2") {
                        if ($("#ddlmemberGrade").val() == "0") {
                            alert("请选择会员等级");
                            return;
                        }
                    }
                    //alert($("#ddlmemberGrade").val());
                    //alert(isvipcheck);

                    $.post("../../ajax/memberManage.aspx", { isvip: isvipcheck, memberGrade: $("#ddlmemberGrade").val(), id: $("#hidid").val() },
                    function (data) {
                        if (data == 1) {
                            parent.layer.alert("添加成功", function () {
                                parent.location.reload();
                            });
                        } else if (data == 2) {
                            parent.layer.alert("修改成功", function () {
                                parent.location.reload();
                            });
                        } else {
                            parent.layer.msg("操作失败");
                        }
                    });
                    return false;
                }
            });
        });
    </script>
</body>
</html>
